home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / FAQ.SWG / 0044_On Pascal ....pas < prev    next >
Pascal/Delphi Source File  |  1995-02-28  |  8KB  |  226 lines

  1. TOPIC    :  Cool stuff Borland left out of their TP manuals. ;-)
  2. FOR      :  TP 4.0+
  3. -----------------------------------------------------------------
  4. This  post  is  about  cool  programming  concepts  that  will be
  5. referred  to either  directly or  indirectly in  my ON PASCAL ...
  6. tutorial series of messages.
  7.  
  8. The underlying  programming style that will  be implemented in my
  9. posts  is  called  OBP,  Object  Based  Programming,  or  Modular
  10. Programming. This programming style provides many of the benefits
  11. of Object  Oriented Programming (OOP) without  actually having to
  12. use OOP code in your programs.
  13.  
  14. These benefits are namely: 1)the  ability to manage complexity in
  15. your programs, 2)easy to use reusable  object code in the form of
  16. TPUs, and  3)fewer program bugs.  Further, you are  able to stick
  17. with traditional programming methods with OBP.
  18.  
  19. The following  are definitions of cool  programming concepts. You
  20. are  going to  have to  accept on  faith that  these are NOT just
  21. boring definitions!!!  Every time you write  a program you should
  22. be thinking about and using this  cool stuff. As Borland does not
  23. talk about them in the context of OBP, I will. ;-)
  24.  
  25. So, ... It is time to rattle your brains a little.
  26.  
  27. -----------------------------------------------------------------
  28. ABSTRACTION
  29. -----------
  30. It  is the  process by  which programmers  distill the  essential
  31. characteristics of some conception that distinguishes it from all
  32. others. Abstraction is why High Level Programming Languages (HLL)
  33. were invented!  HLLs achieve abstraction  by allowing programmers
  34. to write programs without having to bit-twiddle. Bit-twiddling is
  35. for Assembly  Programming. Every HLL implements  abstraction to a
  36. certain degree.  Hence, bit-twiddlers should  stay with ASM,  and
  37. everybody  else should  start  thinking  in terms  of abstraction
  38. rather than bit-twiddling in their programs!!! ;-)
  39.  
  40.  
  41. ABSTRACT DATA TYPE (ADT)
  42. ------------------------
  43. A data type that  is defined in terms of  the operations that can
  44. be  performed  on  objects  of  that  type  rather  than  by  the
  45. properties   of  the   objects  themselves.   ADTs  represent  an
  46. intermediate    step   between    traditional   programming   and
  47. object-oriented programming.  Among the many  cool uses of  ADTs,
  48. they can make  your code portable. Think of  ADTs as the ultimate
  49. level of abstraction in high level programming.
  50.  
  51.  
  52. BINDING TIME
  53. ------------
  54. The point in a program at which reference to a program's elements
  55. or  abstractions   are  bound  to   specific  computer's  storage
  56. locations and values.
  57.  
  58.  
  59. BLOCK
  60. -----
  61. A block  is a  segment of  source code  that can  be selected and
  62. acted upon as a whole. Think  of blocks as being a relative level
  63. of abstraction.
  64.  
  65.  
  66. CAST
  67. COERCION
  68. --------
  69. A data  conversion from  one type  to another.  They are  used to
  70. selectively turn off type checking in TP.
  71.  
  72.  
  73. DATA TYPE
  74. ---------
  75. A definition of a  set of data that specifies  the possible range
  76. of values of the set, the operations that can be performed on the
  77. values, and the way in which the values are stored in memory. The
  78. concept of a data type  makes data manipulation more abstract and
  79. hides the  underlying binary representation of  the data. We will
  80. be using  Modules to implement  Data Types in  TP. Think of  data
  81. types instead of just types as they are the total package!!!
  82.  
  83.  
  84. DYNAMIC BINDING
  85. LATE BINDING
  86. ---------------
  87. Binding that occurs during program  execution. We will achieve to
  88. a degree  this  type  of  binding  with  traditional  programming
  89. methods using procedural types and pointers.
  90.  
  91.  
  92. GLOBAL VARIABLE
  93. ---------------
  94. A variable  whose  value  can  be  accessed  and  modified by any
  95. statement in  a program. These variables  exist during the entire
  96. time  a  program  executes.  Conventional  wisdom  is that Global
  97. variables are  to be avoided  as they can  easily result in  side
  98. effects.
  99.  
  100.  
  101. INFORMATION HIDING
  102. ------------------
  103. A design practise  in which implementation details  for both data
  104. structures  and  algorithms  within  a  module  are  hidden  from
  105. routines using  same. What is  hidden does not  contribute to the
  106. essential  characteristics  of  the  abstraction.  In  theory, it
  107. allows you to use modules in  a manner different from the planned
  108. way without breaking  the routine that calls it.  In short units,
  109. modules, and routines  are supposed to give out  information on a
  110. need to know basis only, in order to avoid side effects.
  111.  
  112.  
  113. LOCAL VARIABLE
  114. --------------
  115. A program variable whose scope in TP  is limited to a given block
  116. of code  or routine. These  variables exist only  while the given
  117. routine is executing. Conventional wisdom  is that you should use
  118. Local rather than Global variables in your program.
  119.  
  120.  
  121. MODULAR DESIGN
  122. --------------
  123. An approach to software design in  which a program is broken down
  124. into  small units,  or modules,  each of  which can be developed,
  125. tested,  and finished  independently before  being combined  with
  126. other modules.
  127.  
  128.  
  129. MODULAR VARIABLE
  130. ----------------
  131. A conceptual subset  of global variables.  They exist during  the
  132. entire  length  of  program  execution  but  can  be accessed and
  133. modified ONLY by  a block of code known as  a module. They are to
  134. be considered good global. In TP, we will be implementing Modular
  135. variables  with OBP.  You will  need  to  use these  since it  is
  136. impractical to avoid all use of global variables.
  137.  
  138. --> Continued to next message
  139.  
  140.  * SLMR 2.1a * Great minds discuss ideas; Small ones discuss people!
  141. ---
  142.  * Communications Systems BBS, Richmond, VA, (804)285-7231
  143.  * PostLink(tm) v1.20  COMMSYS (#923) : RelayNet(tm)
  144. 
  145. {SWAG=???.SWG,JOHN GOHDE,On Pascal ... #0011 2:2}
  146. --> Continued from previous message
  147.  
  148. MODULE
  149. ------
  150. A collection  of routines  and  data  structures that  performs a
  151. particular task or implements a particular abstract data type. We
  152. will  implement modules  in TP  as a  conceptual block of related
  153. units.
  154.  
  155.  
  156. OBJECT BASED PROGRAMMING (OBP)
  157. MODULAR PROGRAMMING
  158. ------------------------------
  159. A precursor of  object-oriented programming in  which the program
  160. is broken down into several independently compiled modules. It is
  161. considered a refinement of  structured programming or traditional
  162. programming  methods. OBP  recognizes the  strong role  that data
  163. plays in programs.
  164.  
  165.  
  166. PASCAL
  167. ------
  168. A programming language designed to encourage programmers to write
  169. modular and well structured  programs. With Pascal the programmer
  170. is supposed to deal with  abstractions rather than always working
  171. directly  with computer  memory.  Pascal  was designed  for those
  172. programmers who  want the highest levels  of abstraction possible
  173. in their programs.  Did you know that?  ;-)
  174.  
  175.  
  176. SIDE EFFECT
  177. -----------
  178. An unanticipated  effect or change  of state caused  by a routine
  179. that happens when  the program is executed. In  other words, they
  180. are program "bugs".
  181.  
  182.  
  183. STATIC BINDING
  184. EARLY BINDING
  185. --------------
  186. Binding that  occurs during program compilation  or linkage. This
  187. is the binding used with traditional programming methods.
  188.  
  189.  
  190. STRONG TYPING
  191. -------------
  192. A characteristic  of Pascal  that does  not allow  the program to
  193. change the type of a variable during program execution.
  194.  
  195.  
  196. STRUCTURED PROGRAMMING (SP)
  197. TRADITIONAL PROGRAMMING METHODS
  198. -------------------------------
  199. A style   of   programming   designed   to   make  programs  more
  200. comprehensible  and  programming  errors  less frequent. Strictly
  201. speaking, SP concentrates on algorithms  or flow of control while
  202. neglecting the role of data or objects.
  203.  
  204.  
  205. TYPE
  206. ----
  207. Defines the nature of a variable. It is a level of abstraction.
  208.  
  209.  
  210. TYPE CHECKING
  211. -------------
  212. The examination by  a compiler of the operations  in a program to
  213. make sure that  the operations make sense, that  the correct data
  214. types are being used, and  that all expressions are guaranteed to
  215. be type-consistent.
  216.  
  217.  
  218. VISIBILITY
  219. SCOPE OF ...
  220. -----------
  221. This refers to the extent a given identifier can be referenced in
  222. a program. Another way of looking at  this issue is how long does
  223. an identifier in a program exist.
  224. -----------------------------------------------------------------
  225.  
  226.